/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/25 10:55
  *
  * @file       pd_spi_io.h
  * @brief      Header file of SPI GPIO peripheral driver.
  *
  * @note       This file contains the SPI GPIO object declaration.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date          Author       Notes
  *   2024/6/25     Chris        the first version
  *
  ******************************************************************************
  */


#ifndef JLC_SKY_SPI_IO_H
#define JLC_SKY_SPI_IO_H

#include "pd_gpio.h"
#include "drivers.h"

typedef struct SPIGPIODef SPIGPIO;

struct SPIGPIODef {
    GPIO **ssel;        // Slave Select
    uint8_t sselSize;   // Slave Select line size

    GPIO *sclk;  // Clock
    GPIO *mosi;  // Master Output Slave Input
    GPIO *miso;  // Master Input Slave Output

};

extern const struct SPIGPIOClass {
    SPIGPIO *(*build)(GPIO **ssel, uint8_t sselSize,
                          GPIO *sclk, GPIO *mosi, GPIO *miso);
} SPIGPIOBuilder;

#endif //JLC_SKY_SPI_IO_H
